#ifdef __cplusplus
extern "C" {
#endif


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>

#ifndef COMMON_H
#define COMMON_H

#define msleep(x) usleep(1000*(x))

typedef enum{
	NO_ERROR,
	SENSOR_OPEN_FAILED,
	SENSOR_NOT_OPEN,
	SENSOR_CREATETHREAD_FAILED,
	CTRB_OPEN_FAILED,
	CTRB_INVALID_CMD,
	CTRB_NOT_OPEN,
	PIDCTR_CONF_READFAILED,
	PIDCTR_CONF_WRITEFAILED,
	WORK_INIT_FAILED,
	WORK_STOP_FAILED,
}RETURN_ID;

#define DEBUG 1

#if DEBUG
#define DBGINFO(str...) printf(str)
#else
#define DBGINFO(str...) while(0)
#endif

#ifndef U64
#define U64 unsigned long long int
#endif


#define SENSOR_INTERVAL 50
#endif

#ifdef __cplusplus
}
#endif

